class Session
  class << self
    def rails_test?
      !Rails.env.production?
    end

    def set_user(user)
      Thread.current[:user_id] = user.id
      Thread.current[:user] = user
    end

    def current_user
      Thread.current[:user]
    end

    def current_user_id
      Thread.current[:user_id]
    end
  end
end
